
<%@ page import="com.surelution.projects.crm.MarketTracking" %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta name="layout" content="main" />
        <g:set var="entityName" value="${message(code: 'marketTracking.label', default: 'MarketTracking')}" />
        <title><g:message code="default.list.label" args="[entityName]" /></title>
    </head>
    <body>
        <div class="nav">
            <span class="menuButton"><a class="home" href="${createLink(uri: '/')}"><g:message code="default.home.label"/></a></span>
            <span class="menuButton"><g:link class="create" action="create"><g:message code="default.new.label" args="[entityName]" /></g:link></span>
        </div>
        <div class="body">
            <h1><g:message code="default.list.label" args="[entityName]" /></h1>
            <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>
            <div class="list">
                <table>
                    <thead>
                        <tr>
                        
                            <g:sortableColumn property="id" title="${message(code: 'marketTracking.id.label', default: 'Id')}" />
                        
                            <g:sortableColumn property="market" title="${message(code: 'marketTracking.market.label', default: 'market')}" />

                            <g:sortableColumn property="handleTime" title="${message(code: 'marketTracking.handleTime.label', default: 'Handle Time')}" />
                        
                            <g:sortableColumn property="handler" title="${message(code: 'marketTracking.handler.label', default: 'handler')}" />
                        
                            <g:sortableColumn property="reason" title="${message(code: 'marketTracking.reason.label', default: 'reason')}" />

                            <g:sortableColumn property="description" title="${message(code: 'marketTracking.description.label', default: 'Description')}" />

                            <g:sortableColumn property="needFollowup" title="${message(code: 'marketTracking.needFollowup.label', default: 'Need Followup')}" />
                        
                            <g:sortableColumn property="preTracking" title="${message(code: 'marketTracking.preTracking.label', default: 'preTracking')}" />
                        </tr>
                    </thead>
                    <tbody>
                    <g:each in="${marketTrackingInstanceList}" status="i" var="marketTrackingInstance">
                        <tr class="${(i % 2) == 0 ? 'odd' : 'even'}">
                        
                            <td><g:link action="show" id="${marketTrackingInstance.id}">${fieldValue(bean: marketTrackingInstance, field: "id")}</g:link></td>
                        
                            <td>${fieldValue(bean: marketTrackingInstance, field: "market.name")}</td>

                            <td><g:formatDate date="${marketTrackingInstance.handleTime}" format="yyyy-MM-dd"/></td>
                        
                            <td>${fieldValue(bean: marketTrackingInstance, field: "handler.username")}</td>
                        
                            <td>${fieldValue(bean: marketTrackingInstance, field: "reason.title")}</td>

                            <td><richui:teaser value="${marketTrackingInstance.description}" length="10"/></td>

                            <td><g:formatBoolean boolean="${marketTrackingInstance.needFollowup}" /></td>

                            <td>
   					    		<g:if test="${marketTrackingInstance.preTracking}">
                            	<g:link action="show" id="${marketTrackingInstance.preTracking?.id}"><label title="${marketTrackingInstance.description}">${marketTrackingInstance.preTracking?.handler?.username},${marketTrackingInstance.preTracking?.handleTime.format("yyyy-MM-dd")}</label></g:link>
                            	</g:if>
                            </td>
                        
                        </tr>
                    </g:each>
                    </tbody>
                </table>
            </div>
            <div class="paginateButtons">
                <g:paginate total="${marketTrackingInstanceTotal}" />
            </div>
        </div>
    </body>
</html>
